#ifndef __GENERIC_GPIO_H__
#define __GENERIC_GPIO_H__

#define ENABLE  1
#define DISABLE  0
#define ON  1
#define OFF  0

#define IIC_SCL    0
#define IIC_SDA    1
#define TOUCH_INT     5

#define USB_DM    18
#define USB_DP     19
#define GPIO_OUTPUT_PIN_SEL  ((1ULL<<IIC_SCL) | (1ULL<<IIC_SDA))

#define GPIO_INPUT_PIN_SEL  ((1ULL<<TOUCH_INT))

#define ESP_INTR_FLAG_DEFAULT 0
#define SDA_OUT gpio_set_direction(IIC_SDA, GPIO_MODE_OUTPUT);
#define SDA_IN gpio_set_direction(IIC_SDA, GPIO_MODE_INPUT);
#define SCL_OUT gpio_set_direction(IIC_SCL, GPIO_MODE_OUTPUT);
#define SCL_IN gpio_set_direction(IIC_SCL, GPIO_MODE_INPUT);

#define SCL_1  gpio_set_level(IIC_SCL, 1)
#define SCL_0  gpio_set_level(IIC_SCL, 0)
 
#define SDA_1  gpio_set_level(IIC_SDA, 1)
#define SDA_0  gpio_set_level(IIC_SDA, 0)

#ifdef IIC2

#define SDA2_OUT gpio_set_direction(IIC_SDA2, GPIO_MODE_OUTPUT);
#define SDA2_IN gpio_set_direction(IIC_SDA2, GPIO_MODE_INPUT);
#define SCL2_OUT gpio_set_direction(IIC_SCL2, GPIO_MODE_OUTPUT);
#define SCL2_IN gpio_set_direction(IIC_SCL2, GPIO_MODE_INPUT);

#define SCL2_1  gpio_set_level(IIC_SCL2, 1)
#define SCL2_0  gpio_set_level(IIC_SCL2, 0)
 
#define SDA2_1  gpio_set_level(IIC_SDA2, 1)
#define SDA2_0  gpio_set_level(IIC_SDA2, 0)
#endif

extern void analog_IIC_Init(void);
extern void generic_gpio(void);


#endif